<!--/* 信息 */-->
<section xmlns:th="https://www.thymeleaf.org" th:fragment="user" class="aside-user card">
  <img
    th:src="${theme.config.loading.img.preload}"
    onerror="this.src=''"
    th:data-lazy-src="${#strings.isEmpty(contributor.avatar) ?  '/' : contributor.avatar}"
    th:alt="${contributor.displayName}"
    class="avatar"
  >

  <h1 class="name" th:text="${contributor.displayName}"></h1>

  <div class="desc" th:text="${contributor.bio}"></div>

  <div class="data w-100">
    <a class="item" title="文章" href="/archives">
      <div class="headline">文章</div>
      <div class="num" th:text="${stats.post}"></div>
    </a>
    <a class="item" href="/categories" title="分类">
      <div class="headline">分类</div>
      <div class="num" th:text="${stats.category}"></div>
    </a>
    <a class="item" title="评论" href="javascript:">
      <div class="headline">点赞</div>
      <div class="num" th:text="${stats.upvote}"></div>
    </a>
  </div>

  <a target="_blank" th:href="${theme.config.aside.button.link}">
    <button class="button" th:utext="${theme.config.aside.button.name}"></button>
  </a>

  <div class="social" th:with="social = ${not #lists.isEmpty(theme.config.aside.social)}">
    <a th:each="item : ${theme.config.aside.social}" class="link" target="_blank" th:title="${item.name}" th:href="${item.link}" th:utext="${item.icon}"></a>
  </div>
</section>

<!--/* 公告 */-->
<section xmlns:th="https://www.thymeleaf.org" th:fragment="notice" class="aside-notice title card">
  <h1 class="title">
    <i class="fa-duotone fa-bullhorn fa-shake"></i>
    <span class="name">公告</span>
  </h1>

  <div class="content" th:utext="${theme.config.aside.notice}"></div>
</section>

<!--/* 分类 */-->
<section xmlns:th="https://www.thymeleaf.org" th:fragment="category" th:if="${theme.config.aside.enable_category}" class="aside-category card">
  <h1 class="title">
    <i class="fa-duotone fa-layer-group"></i>
    <span class="name">分类</span>
  </h1>

  <div class="content" th:with="categories = ${categoryFinder.list(1,5)},noData = ${not #lists.isEmpty(categories)}">
    <th:block th:if="${noData}">
      <a class="link" th:each="category : ${categories.items}" th:href="@{${category.status.permalink}}">
        <span class="name" th:text="${category.spec.displayName}"></span>
        <span class="num" th:text="${category.status.visiblePostCount}"></span>
      </a>
    </th:block>
    <th:block th:unless="${noData}" th:insert="~{views/components:: emptyData(false)}"></th:block>
    </ul>
  </div>
</section>

<!--/* 标签 */-->
<section xmlns:th="https://www.thymeleaf.org" th:fragment="tags" th:if="${theme.config.aside.enable_tags}" class="aside-tags card">
  <h1 class="title">
    <i class="fa-duotone fa-tags"></i>
    <span class="name">标签</span>
  </h1>

  <div class="content" th:with="tags = ${tagFinder.list(1,25)},noData = ${not #lists.isEmpty(tags)}">
    <th:block th:if="${noData}">
      <a class="link" th:each="tag : ${tags.items}" th:if="${tag.status.visiblePostCount > 0}" th:href="@{${tag.status.permalink}}">
        <span class="name" th:text="${tag.spec.displayName}"></span><span class="num" th:text="${'（' + tag.status.visiblePostCount + '）'}"></span>
      </a>
    </th:block>
    <th:block th:unless="${noData}" th:insert="~{views/components:: emptyData(false)}"></th:block>
    </ul>
  </div>
</section>

<!--/* 网站信息 */-->
<section xmlns:th="https://www.thymeleaf.org" th:fragment="webInfo" th:if="${theme.config.aside.enable_webInfo}" class="aside-webInfo card">
  <h1 class="title">
    <i class="fa-duotone fa-chart-simple"></i>
    <span class="name">网站资讯</span>
  </h1>

  <div class="content">
    <div class="item">
      <span>文章数目：</span>
      <span th:text="${stats.post} + '章'"></span>
    </div>
    <div class="item">
      <span>文章点赞：</span>
      <span th:text="${stats.upvote} + '赞'"></span>
    </div>
    <div class="item" th:if="${not #strings.isEmpty(theme.config.base.site_birthday)}">
      <span>运行时间：</span>
      <span class="run-day" th:data-date="${theme.config.base.site_birthday}">... 天</span>
    </div>
    <div class="item">
      <span>总访问量：</span>
      <span th:text="${stats.visit} + '人'"></span>
    </div>
  </div>
</section>

<!--/* 侧边栏 */-->
<aside xmlns:th="https://www.thymeleaf.org" th:fragment="common" th:if="${theme.config.aside.enable}" class="aside">
  <th:block th:replace="~{::user}"/>
  <th:block th:replace="~{::notice}"/>
  <th:block th:replace="~{::category}"/>
  <th:block th:replace="~{::tags}"/>
  <th:block th:replace="~{::webInfo}"/>
</aside>

<!--/* 侧边栏-文章 */-->
<aside xmlns:th="https://www.thymeleaf.org" th:fragment="post" class="aside">
  <div class="is-sticky">
    <section class="aside-toc card">
      <h1 class="title">
        <i class="fa-sharp fa-solid fa-list-tree"></i>
        <span class="name">目录</span>
      </h1>
      <div class="toc">
      </div>
    </section>
  </div>
</aside>

